package com.ruoyi.client.mapper;

import com.ruoyi.bookbus.domain.BookFavorite;
import com.ruoyi.client.pojo.vo.FavoriteVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("ClientFavoriteMapper")
public interface FavoriteMapper {

    int insert(BookFavorite favorite);

    BookFavorite selectByPrimaryKey(Long id);

    BookFavorite selectByUserIdAndProductId(@Param("userId") Long userId, @Param("productId") Long productId);

    int deleteByPrimaryKey(Long id);

    int deleteByUserId(Long userId);

    int deleteByUserIdAndProductId(@Param("userId") Long userId, @Param("productId") Long productId);

    List<FavoriteVo> listByUserId(Long userId);
}

